Optimal. Leaf size=23 \[ \frac{A \cos (x)}{1-\sin (x)}-B \log (1-\sin (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.077904, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.267, Rules used = {4401, 2648, 2667, 31} \[ \frac{A \cos (x)}{1-\sin (x)}-B \log (1-\sin (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4401
Rule 2648
Rule 2667
Rule 31
Rubi steps
\begin{align*} \int \frac{A+B \cos (x)}{1-\sin (x)} \, dx &=\int \left (-\frac{A}{-1+\sin (x)}-\frac{B \cos (x)}{-1+\sin (x)}\right ) \, dx\\ &=-\left (A \int \frac{1}{-1+\sin (x)} \, dx\right )-B \int \frac{\cos (x)}{-1+\sin (x)} \, dx\\ &=\frac{A \cos (x)}{1-\sin (x)}-B \operatorname{Subst}\left (\int \frac{1}{-1+x} \, dx,x,\sin (x)\right )\\ &=-B \log (1-\sin (x))+\frac{A \cos (x)}{1-\sin (x)}\\ \end{align*}
Mathematica [A] time = 0.0491608, size = 46, normalized size = 2. \[ \frac{2 A \sin \left (\frac{x}{2}\right )}{\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )}-2 B \log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.057, size = 34, normalized size = 1.5 \begin{align*} -2\,{\frac{A}{\tan \left ( x/2 \right ) -1}}-2\,B\ln \left ( \tan \left ( x/2 \right ) -1 \right ) +B\ln \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.976851, size = 34, normalized size = 1.48 \begin{align*} -B \log \left (\sin \left (x\right ) - 1\right ) - \frac{2 \, A}{\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.96223, size = 127, normalized size = 5.52 \begin{align*} \frac{A \cos \left (x\right ) -{\left (B \cos \left (x\right ) - B \sin \left (x\right ) + B\right )} \log \left (-\sin \left (x\right ) + 1\right ) + A \sin \left (x\right ) + A}{\cos \left (x\right ) - \sin \left (x\right ) + 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 1.3663, size = 94, normalized size = 4.09 \begin{align*} - \frac{2 A}{\tan{\left (\frac{x}{2} \right )} - 1} - \frac{2 B \log{\left (\tan{\left (\frac{x}{2} \right )} - 1 \right )} \tan{\left (\frac{x}{2} \right )}}{\tan{\left (\frac{x}{2} \right )} - 1} + \frac{2 B \log{\left (\tan{\left (\frac{x}{2} \right )} - 1 \right )}}{\tan{\left (\frac{x}{2} \right )} - 1} + \frac{B \log{\left (\tan ^{2}{\left (\frac{x}{2} \right )} + 1 \right )} \tan{\left (\frac{x}{2} \right )}}{\tan{\left (\frac{x}{2} \right )} - 1} - \frac{B \log{\left (\tan ^{2}{\left (\frac{x}{2} \right )} + 1 \right )}}{\tan{\left (\frac{x}{2} \right )} - 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.08306, size = 62, normalized size = 2.7 \begin{align*} B \log \left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right ) - 2 \, B \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}\right ) + \frac{2 \,{\left (B \tan \left (\frac{1}{2} \, x\right ) - A - B\right )}}{\tan \left (\frac{1}{2} \, x\right ) - 1} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]